-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add logout #3
base: stackhpc
Are you sure you want to change the base?
add logout #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see comment inline.
collector/redfish_collector.go
Outdated
@@ -99,6 +99,8 @@ func (r *RedfishCollector) Collect(ch chan<- prometheus.Metric) { | |||
|
|||
ch <- r.redfishUp | |||
ch <- prometheus.MustNewConstMetric(totalScrapeDurationDesc, prometheus.GaugeValue, time.Since(scrapeTime).Seconds()) | |||
defer r.redfishClient.Logout() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, the logout on line 84 should handle the session close. I hadn't seen that.
We can't do it on line 102 because r.redfishClient
could be nil
.
It does appear that we hit the else branch in practise. I see redfish_up = 0
in historical data, and around those times we see dropouts in other data. We need to get to bottom of why that happens.
log.Info("Loging out") | ||
if r.redfishClient == nil { | ||
|
||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just does what is already being done on line 84
No description provided.